<!doctype html>
<html lang="ja">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="/assets/manage.css" type="text/css" />
</head>
<body>
	
<? if(isset($description)) { ?>
	<?= $description; ?><br />
<? } ?>	

<a href="?csv=1">CSV(右クリックで保存)</a><br />
<table>
<tr>
<td>広告ID</td>
<td>取得日</td>
<td>報酬</td>
<td>icon</td>
<td>タイトル</td>
<td>簡易獲得条件</td>
<td>獲得条件</td>
<td>注意事項</td>
<td>アプリ説明</td>
<td>優先度</td>
<td>カテゴリ</td>
<td>操作</td>
</tr>
<? foreach($list as $row => $col) { ?>
<tr>
<form action='/manage/reward/list/' method='post'>
	<input type='hidden' name='action' value='add'> 
<td><?= $col['ad_company']; ?><br /><?= $col['ad_id']; ?></td>
<td><?= substr($col['post_date'],5,5); ?><br><?= substr($col['post_date'],11,5); ?></td>
<td>¥<?= $col['payment']; ?><br><?= $col['point']; ?>pt</td>
<td><img src='<?= $col['icon']; ?>' width=64 height=64></td>
<td><textarea name='title' cols=10 rows=4><?= $col['title']; ?></textarea></td>
<td><textarea name='subtitle' cols=15 rows=4><?= $col['subtitle']; ?></textarea></td>
<td><textarea style="<?= strpos($col['advertisement'],'2. ') === false ? '' : 'background-color:#ffcccc'; ?>" name='advertisement' cols=15 rows=4><?= $col['advertisement']; ?></textarea></td>
<td><textarea name='notice' cols=15 rows=4><?= $col['notice']; ?></textarea></td>
<td><textarea name='description' cols=15 rows=4><?= $col['description']; ?></textarea></td>
<td><input type='text' name='score' value='<?= $col['score']; ?>' size=3></td>
<td><input type='text' name='category' value='<?= $col['category']; ?>' size=7></td>
<? if(isset($col['added'])) {?>
<td style="background-color:#ffcccc;">
	掲載中
</td>
<? } else { ?>
<td>
	<input type='hidden' name='ad_company' value='<?= $col['ad_company']; ?>'> 
	<input type='hidden' name='ad_id' value='<?= $col['ad_id']; ?>'> 
	<input type='hidden' name='icon' value='<?= $col['icon']; ?>'> 
	<input type='hidden' name='link' value='<?= $col['link']; ?>'> 
	<input type='hidden' name='point' value='<?= $col['point']; ?>'> 
	<input type='hidden' name='payment' value='<?= $col['payment']; ?>'> 
	<input type='hidden' name='post_date' value='<?= $col['post_date']; ?>'> 
	<input type="submit" value="追加">
</td>
<? } ?>
</tr>
</form>
<? } ?>	
</table>

</body>
</html>